package com.woniu.sale.controller;

import com.woniu.common.entity.Result;
import com.woniu.sale.entity.PurRequestorderdetail;
import com.woniu.sale.service.PurRequestOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/shop/sale")
public class ShopSaleController {
    @Autowired
    private PurRequestOrderService purRequestOrderService;

    /**
     * 代销模块查询代销商品店铺库存的方法
     * @param supply
     * @param shop
     * @return
     */
    @GetMapping("/{supply}/{shop}")
    public Result selShopSale(@PathVariable("supply")Integer supply,@PathVariable("shop")String shop){
        List<PurRequestorderdetail> list = purRequestOrderService.selShopSale(supply,shop);
        System.out.println(list);
        return Result.ok("成功！").data("list",list);
    }
}
